package design_patterns.factory;

import design_patterns.Intermediary;
import net.sf.cglib.proxy.Enhancer;

public class IntermediaryFactory {
    private static Intermediary callback=new Intermediary();
    public static <T> T create(Class<T> target){
        Enhancer enhancer=new Enhancer();
        enhancer.setCallback(callback);
        enhancer.setSuperclass(target);
        return (T) enhancer.create();
    }
}
